<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<div class="middle myclear">
	<div class="pad10">
		<br />
		<h3>Muachung weekly service logs</h3>
		<br />
		<table class="martop10 marbottom10">
			<tr>
				<td>
					Date: <input type="text" size="15" name="slDate" id="slDate" value="<?php echo $el_date?>" />
				</td>
				<td>
					<input type="button" value=" Go " onclick="logMcFilterChange()" />
				</td>
			</tr>
		</table>
		
		<table class="tb-pad5" width="100%" border="1" style="border-color: #ccc; border-width:  1px 1px; border-collapse:  collapse; background: #fff;" class="martop10">
			<tr>
				<td class="pad5" width="10%" >
					<b><?php echo $lang['action']?></b>
				</td>
				<td class="pad5">
					<b>Danh sách ID update</b>
				</td>
				<td class="pad5" width="300">
					<b>BannerID - CTR</b>
				</td>
								
				<td class="pad5 text-center" width="100" >
					<b><?php echo $lang['time']?></b>
				</td>
				<td class="pad5 text-center" width="100" >
					<b><?php echo $lang['user']?></b>
				</td>
			</tr>
			<?php
			foreach ($email_log as $row)
			{
			?>
			<tr>
				<td>
					Muachung weekly service
				</td>
				
				<td>
					<?php
					echo str_replace(',', ', ', $row['before']);
					?>
				</td>
				<td>
					<?php
					echo $row['after'];
					?>
				</td>
				<td class="text-center">
					<?php echo $row['createtime']?>
				</td>
				<td class="text-center">
					<?php echo $row['username']?>
				</td>
			</tr>
			<?php
			}
			?>
		</table>
		<div class="brv-paging-left padtop10">
			<table class="tbl-list brv-paging" border="1">
				<tr>
					<td class="brv-paging-name">
						<?php echo $lang['page'].' '. $page.' ['.$total_page.']'?>
					</td>
					
					<td class="brv-paging-pre-next">
						<img class="brv-img-pre" alt="previous" src="/images/imgpre.gif" onclick="goMcPage(<?php echo $page > 1 ? $page - 1 : $page;?>)" />
						<img class="brv-img-next" alt="next" src="/images/imgnext.gif" onclick="goMcPage(<?php echo $page + 1;?>)" />
					</td>
				</tr>
			</table>
		</div>
	</div>
</div>

<script type="text/javascript">
	$('#slDate').DatePicker({
		format:'Y-m-d',
		date: '<?php if($el_date!='') echo $el_date; else echo date('Y-m-d');?>',
		starts: 1,
		onChange: function(formated, dates){
			$('#slDate').val(formated);
			$('#slDate').DatePickerHide();
		}
	});
	function logMcFilterChange()
	{
		var _query = "?";
		_query += "&el_date=" + $('#slDate').val();
		
		window.location.href="<?php echo site_url('logs/mcweekly_service/')?>" + _query;
	}
	function goMcPage(strVal)
	{
		var _query = "?";
		_query += "&el_date=" + $('#slDate').val();
		_query += "&page=" + strVal;
		
		window.location.href="<?php echo site_url('logs/mcweekly_service/')?>" + _query;
	}
</script>